-
Notifications
You must be signed in to change notification settings - Fork 178
[macros] add support for on_start/on_end to select_loop! #2671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
commonware-mcp | 35361df | Jan 23 2026, 08:13 PM |
Deploying monorepo with
|
| Latest commit: |
35361df
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://84934453.monorepo-eu0.pages.dev |
| Branch Preview URL: | https://andre-select-loop-start-end.monorepo-eu0.pages.dev |
|
For the places where I updated the code to use |
8f82089 to
101b82d
Compare
c453f05 to
35361df
Compare
| }, | ||
| // Handle mailbox messages | ||
| msg = self.mailbox.next() => { | ||
| let Some(msg) = msg else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next feature for this actor sprint would be to automatically handle this IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
patrick-ogrady
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hide whitespace ftw
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #2671 +/- ##
==========================================
- Coverage 92.25% 92.16% -0.10%
==========================================
Files 382 382
Lines 121713 121913 +200
==========================================
+ Hits 112289 112360 +71
- Misses 9424 9553 +129
... and 9 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This PR extends the
select_loop!macro with optionalon_startandon_endblocks, enabling cleaner patterns for code that needs to run at the beginning or end of each loop iteration.The
on_startblock executes before the select, allowing variable initialization that's visible to all arms. Theon_endblock runs after any non-shutdown arm completes but is skipped when shutdown triggers, which is useful for cleanup or post-processing logic. Both blocks share lexical scope with the select arms.This allows migrating some more places to use the
select_loop!macro.